﻿<!--
____________________    _____  _________           _________ .____    .___
\______   \______   \  /  _  \ \_   ___ \          \_   ___ \|    |   |   |
 |       _/|    |  _/ /  /_\  \/    \  \/   ______ /    \  \/|    |   |   |
 |    |   \|    |   \/    |    \     \____ /_____/ \     \___|    |___|   |
 |____|_  /|______  /\____|__  /\______  /          \______  /_______ \___|
        \/        \/         \/        \/                  \/        \/
权限脚手架系统
2018.08.15 By bobi
-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>RBAC-CLI - 登陆</title>
    <meta name="keywords" content="RBAC,CLI,权限,权限脚手架">
    <meta name="description" content="一款基于Spring+SpringMVC+Mybatis+Shiro的一个权限脚手架，用户可在此基础上很方便的进行二次开发！">
    <!--浏览器默认内核指定-->
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <!--指定IE8浏览器去模拟某个特定版本的IE浏览器的渲染方式-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <!--设置移动端自适应-->
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <!--禁止搜索引擎转码-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--在浏览器收藏夹中显示的图标-->
    <link rel="Bookmark" href="/resources/favicon.ico">
    <!--网页标题小图标-->
    <link rel="Shortcut Icon" href="/resources/favicon.ico"/>
    <!--css引入-->
    <link href="/resources/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css"/>
    <link href="/resources/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css"/>
    <link href="/resources/static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/resources/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/resources/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/resources/lib/respond.min.js"></script>
    <![endif]-->
    <!--[if IE 6]>
    <script type="text/javascript" src="/resources/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
</head>
<body>
<div class="header">RBAC-CLI - 权限脚手架系统</div>
<div class="loginWraper">
    <div class="loginBox">
        <form class="form form-horizontal" method="post" id="loginForm" onsubmit="return false;">
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-8">
                    <input id="username" name="username" type="text" placeholder="账户" class="input-text size-L" autocomplete="off">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-8">
                    <input id="password" name="password" type="password" placeholder="密码" class="input-text size-L" autocomplete="off">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe725;</i></label>
                <div class="formControls col-xs-8">
                    <input id="captcha" name="captcha" type="text" placeholder="验证码" class="input-text size-L"  autocomplete="off" maxlength="4" style="width:150px;">
                    <img src="/captcha" id="vimg"> <a href="javascript:;" onclick="kanbuq()">看不清，换一张</a>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <label for="rememberMe">
                        <input type="checkbox" name="rememberMe" id="rememberMe" value="0">使我保持登录状态
                    </label>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <input type="submit" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;" id="loginBtn">
                    <input type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
                </div>
            </div>
        </form>
    </div>
</div>
<div class="footer">
    © 2003-2018 Eas.cn. All rights reserved. [ <a href="http://www.miitbeian.gov.cn" target="_blank">蜀ICP备xxxxxxxx号</a> ]
</div>
<script type="text/javascript" src="/resources/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/resources/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/resources/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript">
    // 跳出iframe框架页
    if (window != top) {
        top.location.href = location.href;
    }

    // 看不清
    function kanbuq() {
        $("#vimg").attr("src", "/captcha?random=" + Math.random());
    }

    // 登录按钮
    $("#loginBtn").click(function () {
        var username = $("#username");
        var password = $("#password");
        var captcha = $("#captcha");
        if (username.val().trim() == "") {
            layer.msg('用户名不能为空', {icon: 5, time: 1000});
            username.focus();
            return;
        } else if (password.val() == "") {
            layer.msg('密码不能为空', {icon: 5, time: 1000});
            password.focus();
            return;
        } else if (captcha.val().trim() == "") {
            layer.msg('验证码不能为空', {icon: 5, time: 1000});
            captcha.focus();
            return;
        }
        // 异步请求
        var loadIndex;
        $.ajax({
            type: 'post',
            url: '/login',
            dataType: 'json',
            data: $("#loginForm").serialize(),
            beforeSend: function () {
                loadIndex = layer.load(0, {shade: 0.1});
            },
            complete: function () {
                layer.close(loadIndex);
            },
            success: function (data) {
                if (data.status == 0) {
                    layer.msg(data.msg, {icon: 1, time: 1000}, function () {
                        window.location = "/admin";
                    });
                } else {
                    layer.msg(data.msg, {icon: 5, time: 1000});
                    kanbuq(); // 刷新验证码
                }
            },
            error: function () {
                layer.msg('服务器错误', {icon: 5, time: 1000});
            }
        });
    });
</script>
</body>
</html>